﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace IncomingChatObserver
{
    [ServiceContract]
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    public sealed class IncomingChatService
    {
        private static readonly IncomingChatService instance = new IncomingChatService();
        private SChat notifyChat;
        public delegate void SChat(string guid, string password);

        public SChat NotifyChat
        {
            get { return notifyChat; }
            set { notifyChat = value; }
        }

        private IncomingChatService() { }

        public static IncomingChatService Instance
        {
            get { return instance; }
        }

        [OperationContract]
        void StartChat(string chatGuid, string chatPassword)
        {
            if (notifyChat != null)
                notifyChat(chatGuid, chatPassword);
        }
    }



}
